/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package business;

import dal.UserDAL;
import java.util.List;
import model.Admin;
import model.Customer;
import model.Feedback;

/**
 *
 * @author Administrator
 */
public class UserBusiness {

    private UserDAL userDAL = new UserDAL();

    public Admin loginAdmin(Admin admin) {
        if (userDAL.loginAdmin(admin) != null) {
            return userDAL.loginAdmin(admin);
        } else {
            return null;
        }
    }

    public Customer loginCustomer(Customer customer) {
        if (userDAL.loginCustomer(customer) != null) {
            return userDAL.loginCustomer(customer);
        } else {
            return null;
        }
    }

    public boolean register(Customer customer) {
        if (userDAL.register(customer)) {
            return true;
        }
        return false;
    }

    public boolean customerFeedback(int cusID, String title, String content) {
        if (userDAL.customerFeedback(cusID, title, content)) {
            return true;
        }
        return false;
    }

    public List<Feedback> listAllFeedback(){
        return userDAL.listAllFeedback();
    }
}
